﻿
namespace FileZillaConfig.ConfigClasses
{
    public class MODEZCompression
    {
        private bool _enabled;
        private int _minimum;
        private int _maximum;
        private bool _allowLocal;
        private string _disallowedIPs;

        /// <summary>
        /// Don't use MODE Z for the following IP addresses
        /// </summary>
        public string DisallowedIPs
        {
            get { return _disallowedIPs; }
            set { _disallowedIPs = value; }
        }


        /// <summary>
        /// To conserve CPU power MODE Z should not be used inside local networks
        /// </summary>
        public bool AllowLocal
        {
            get { return _allowLocal; }
            set { _allowLocal = value; }
        }


        /// <summary>
        /// Maximum allowed compression level (8-9)
        /// </summary>
        public int MaximumCompression
        {
            get { return _maximum; }
            set {
                if (value >= 8 && value <= 9)
                {
                    _maximum = value;
                }
                else
                {
                    throw new System.Exception("Value must be integer between 8 and 9.");
                } 
            }
        }


        /// <summary>
        /// Minimum allowed compression level (1-8)
        /// </summary>
        public int MinimumCompression
        {
            get { return _minimum; }
            set {
                if (value >= 1 && value <= 8)
                {
                    _minimum = value;
                }
                else
                {
                    throw new System.Exception("Value must be integer between 1 and 8.");
                }
                 
            }
        }


        /// <summary>
        /// Enable MODE Z support
        /// </summary>
        public bool Enabled
        {
            get { return _enabled; }
            set { _enabled = value; }
        }

    }
}
